from django.template import loader, Context
from django.http import HttpResponse

def index(request):
    if request.method == "POST":
        text = request.POST['mytext']
        return HttpResponse(text)
    else:
        t = loader.get_template('index.html')
        c = Context({'action': request.path})
        return HttpResponse(t.render(c))